using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using ElevatorSpeeches.Framework;

using Castle.MonoRail.TestSupport;
namespace ElevatorSpeeches.Tests
{

    [TestFixture]
    public class SpeechControllerTestCase : BaseTest
    {
        [Test]
        public void SpeechControllerTest()
        {
            SpeechTopic topic = SpeechTopic.FindFirst(new NHibernate.Expression.GeExpression("ID", 0));
            DoGet("SpeechTopic/display.rails", "prettyUrl=" + topic.PrettyUrl);
            AssertReplyContains(topic.Title);
        }


        [Test]
        public void SpeechTopicAdd()
        {        
            List<string> parameters = new List<string>();
            parameters.Add("title=newtitle");
            parameters.Add("tags=blah,blah2");

            DoPost("SpeechTopic/save.rails", parameters.ToArray());
            AssertReplyContains("newtitle");
        }
    }
}
